package org.momo.rpc.config.config;

import lombok.Data;
import org.momo.rpc.config.config.registry.ZkRegistryConfig;
import org.momo.rpc.constant.LoadBalanceKey;
import org.momo.rpc.constant.RegistryKey;
import org.momo.rpc.constant.RetryPolicyKey;
import org.momo.rpc.constant.SerializeKey;

/**
 * RPC全局配置
 */
@Data
public class RpcConfig {
    /**
     * 服务器主机
     */
    private String serverHost = "127.0.0.1";

    /**
     * 服务器端口
     */
    private int serverPort = 8081;

    /**
     * 序列化器
     */
    private String serializer = SerializeKey.JSON.getKey();

    /**
     * 注册中心
     */
    private String registry = RegistryKey.ZOOKEEPER.getKey();

    /**
     * 注册中心配置
     */
    private ZkRegistryConfig registryConfig = new ZkRegistryConfig();

    /**
     * 负载均衡器
     */
    private String loadBalancer = LoadBalanceKey.POLLING.getKey();

    /**
     * 重试策略
     */
    private String retryPolicy = RetryPolicyKey.FIXED.getKey();

    /**
     * 容错策略
     */
    // private String tolerantStrategy = TolerantStrategyKey.FAIL_FAST;

    private String client = "netty";

    private String server = "netty";
}

